<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>云萌科技</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <meta name="format-detection" content="telephone=no">
  <style>
    * {
      margin: 0;
      padding: 0;
      font-family: "微软雅黑";
      text-decoration: none;
    } 

    .head_body{
      background: #fff;
    }

    .tixian_1{
      height: 60px;
    }

    .tixian_2{
      padding-left: 20px;
      font-weight: 700;
    }

    .tixian_3{
      padding-left: 30px;
    }

    input{
      border:0px solid #fff;
      height: 30px;
      line-height: 30px;
    }

    .tijiao{
      width: 100%;
      text-align: center;
      margin-top: 36px;
    }

    .subbut{
      display: inline-block;
      height: 38px;
      line-height: 38px;
      padding: 0 18px;
      background-color: #009688;
      color: #fff;
      white-space: nowrap;
      text-align: center;
      font-size: 14px;
      border: none;
      border-radius: 2px;
      cursor: pointer;
    }

    .disabled{
      background: #fff;
    }
  </style>
</head>

<body class="head_body">
  <form id="form" onsubmit="return false">
  <table>
    <tr class="tixian_1">
      <td class="tixian_2">开户姓名</td>
      <td class="tixian_3"><input id="txname" name="txname" type="text" placeholder="开户姓名" value="{$info.txname}"></td>
    </tr>
    <tr class="tixian_1">
      <td class="tixian_2">提现账户</td>
      <td class="tixian_3"><input id="txzhanghu" name="txzhanghu" type="text" placeholder="银行卡号/支付宝账户" value="{$info.txzhanghu}"></td>
    </tr>
    <tr class="tixian_1">
      <td class="tixian_2">提现银行</td>
      <td class="tixian_3"><input id="txyinhang" name="txyinhang" type="text" placeholder="提现银行" value="{$info.txyinhang}"></td>
    </tr>
    <tr class="tixian_1">
      <td class="tixian_2">提现金额</td>
      <td class="tixian_3"><input id="price" name="price" type="text" placeholder="提现金额" ></td>
    </tr>
    <tr class="tixian_1">
      <td class="tixian_2">账户余额</td>
      <td class="tixian_3"><input id="yuer" name="yuer" class="disabled" type="text" placeholder="{$info.balance/100}" disabled /></td>
    </tr>
    <input type="hidden" name="id" value="{$info.id}">
  </table>
  <div class="tijiao">
    <input type="submit" onclick="submitForm()" class="subbut" value="申请提现">
  </div>
  <script src="/static/ymkj/js/jquery.min.js"></script>
  <script src="/static/common/layer/layer.js"></script>
  <script type="text/javascript">
    function submitForm(){
      var formData = $('#form').serialize();
      var txname = $('#txname').val();
      var txzhanghu = $('#txzhanghu').val();
      var txyinhang = $('#txyinhang').val();
      var price = $('#price').val();
      if(txname==""){
        layer.alert('开户姓名不能为空', {icon: 5});
      }else if(txzhanghu==""){
        layer.alert('提现账户不能为空', {icon: 5});
      }else if(txyinhang==""){
        layer.alert('提现银行不能为空', {icon: 5});
      }else if(price==""){
        layer.alert('提现金额不能为空', {icon: 5});
      }else{
        $.ajax({
          url:"{:url('user/tixian')}",
          type:"post",
          data:formData,
          success:function(data){
            if(data.code == 1){
              layer.alert(data.msg, {icon: 6},function(index){
                location.href = data.url;
              });
            }else{
              layer.alert(data.msg, {icon: 5});
            }
          }
        })
      }
    }
  </script>
</form>
</body>
</html>